/* 路由配置 */
import { lazy } from 'react'

export default [
  { path: '/', component: lazy(() => import('../pages/Home')) },

  { path: '/login', component: lazy(() => import('../pages/User/Login')) },
  { path: '/register', component: lazy(() => import('../pages/User/Register')) },

  { path: '/product/:id', component: lazy(() => import('../pages/Product/Detail')) },

  { path: '/user-info', component: lazy(() => import('../pages/User/UserInfo')) },

  { path: '/cart-items', component: lazy(() => import('../pages/Cart/CartItems')) },
  { path: '/shipping', component: lazy(() => import('../pages/Pay/Shipping')) },
  { path: '/payment', component: lazy(() => import('../pages/Pay/Payment')) },
  { path: '/confirm-order', component: lazy(() => import('../pages/Pay/ConfirmOrder')) },
  { path: '/order/:id/:auth', component: lazy(() => import('../pages/Pay/Order')) },

  { path: '/admin/user-list', component: lazy(() => import('../pages/Admin/UserList')) },
  { path: '/admin/user-edit/:userId', component: lazy(() => import('../pages/Admin/UserEdit')) },
  { path: '/admin/products-manage', component: lazy(() => import('../pages/Admin/ProductsManage')) },
  { path: '/admin/product-edit/:productId', component: lazy(() => import('../pages/Admin/ProductEdit')) },
  { path: '/admin/orders-manage', component: lazy(() => import('../pages/Admin/OrdersManage')) },
]
